package assql
{
	import flash.utils.ByteArray;
	
	/**
	 * The AS3 mapping for the SQL type BLOB
	 **/
	public interface Blob
	{
		/**
		 * Returns all or part of the Blob
		 * 
		 * @param index the offset in which to start reading at
		 * @count the number of bytes to read
		 **/
		function getByteArray(index:int=0, count:int=0):ByteArray;
		
		/**
		 * Returns the length of the Blob object
		 **/
		function get length():int;
		
		/**
		 * Writes all or some of the bytes into this Blob object.
		 * 
		 * @param bytes The bytes to write into the Blob
		 * @param pos The position withint the Blob to start writing bytes.
		 * @param offset The offset in the source bytes to start reading
		 * @param len The number of bytes to write into the Blob from the source bytes
		 **/
		function setBytes(bytes:ByteArray, pos:int=0, offset:int=0, len:int=0):void;
		
		/**
		 * Truncates the Blob value to the specified length.
		 * 
		 * @param The length to truncate to.
		 **/
		function truncate(len:int):void;
	}
}